package com.example.demo.api;

import com.example.demo.bean.Response;
import com.example.demo.bean.bis.Picture;
import com.example.demo.service.bis.PictureService;
import com.example.demo.utils.ConstantUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zzz
 * @Title: PictureController
 * @ProjectName test
 * @Description: TODO()
 * @date 2018/8/1
 */
@RestController
@Api(value="图片controller",tags={"图片接口"})
public class PictureController {

    @Autowired
    private PictureService pictureService ;

    @ApiOperation(value="申诉申请图片" )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "uId", value = "用户ID", required = true,dataType = "int",paramType = "form"),
    })
    @PostMapping(value="/priture/uid")
    public Response insert( Integer uId){
        List<Picture> list = pictureService.findByUid(uId);
        return new Response(ConstantUtils.SUCCEED,ConstantUtils.STRING_SUCCEED,list.size()==ConstantUtils.SUCCEED?"":list);
    }


}
